import instance from "../utils/request";

// 定义验证码接口
export function captchaApi() {
    return instance({
        url: "/captcha/api/math",
        method: "get",
    })
}

// 定义登录验证
export function loginApi(data) {
    return instance({
        url: "/api/common/auth/login",
        method: "post",
        data
    })
}


// 定义用户列表
export function userApi(data) {
    return instance({
        url: "/api/users",
        method: "get",
        params: data,
        headers: { 'Authorization': String(localStorage.getItem("jwt")) },
    })
}

// 定义添加用户
export function addApi(data) {
    return instance({
        url: "/api/users/add",
        method: "post",
        data,
        headers: { 'Authorization': String(localStorage.getItem("jwt")) },
    })
}